package com.ygt.MyServletDemo;

import com.ygt.servlet.HttpServlet;
import com.ygt.servlet.HttpServletRequest;
import com.ygt.servlet.HttpServletResponse;
import com.ygt.util.ResponseUtil;
import com.ygt.webServlet.WebServlet;

import java.io.IOException;

/**
 * @Author ygt
 * @Date 2022/11/8 18:07
 * @Version 1.0
 * 用户自定义的servlet类
 */

@WebServlet(urlMapping = "/my")
public class MyServlet extends HttpServlet {
    @Override
    public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.GetWriter(ResponseUtil.getResponseHeader200("this is get Method"));
    }

    @Override
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.GetWriter(ResponseUtil.getResponseHeader200("this is post Method"));
    }
}
